<template>
  <div id='index'>
    <com-head :opacity='1'>首页</com-head>
    <div class="index">
      <div class="indexbg"></div>
      <div class="lunbo">
        <mt-swipe :auto="3000">
          <mt-swipe-item  v-for="(item,index) in images" :key="index"><img :src="item"></mt-swipe-item>
        </mt-swipe>
      </div>
      <div class="index_nav">
        <div class="nav_item" v-for="(item, index) in navList" :key="index" @click="navRoute(item.route)">
          <div class="box"><img :src="item.img" alt=""></div>
          <span>{{ item.name }}</span>
        </div>
      </div>
    </div>
    <div class="sellwell">
      <div class="sellTop"><span>畅销推荐</span><span>更多></span></div>
      <div class="bookList" v-for="(item,index) in bookList" :key="index">
        <div class="left"><img :src="item.book" ></div>
        <div class="right">
          <div class="name">{{item.name}}</div>
          <div class="abstract">{{item.abstract}}</div>
          <div class="pagenum">共{{item.pagenum}}章</div>
        </div>
      </div>
    </div>

    <div class="sellwell author">
      <div class="sellTop"><span>作者介绍</span></div>
      <div class="bookList authormes" v-for="(item,index) in author" :key="index">
        <div class="name">{{item.name}}</div>
        <div class="left"><img :src="item.book" ></div>
        <div class="right">
          <div>{{item.day}},{{item.address}}</div>
          <div class="abstract">{{item.abstract}}</div>
        </div>
      </div>
    </div>
    
    <com-foot :select="0"></com-foot>


    <!-- <com-button :click="fabu">确定发布</com-button> -->
    
  </div>
</template>

<script>
export default {
  name: "index",
  data() {
    return {
      images: [
        require("../assets/image/img/lunbo.png"),
        require("../assets/image/img/lunbo.png"),
        require("../assets/image/img/lunbo.png")
      ],
      bookList: [
        {
          book: require("../assets/image/img/book2.png"),
          name: "白鹿原",
          abstract: "这个书不错哦",
          pagenum: "88"
        },
        {
          book: require("../assets/image/img/book4.png"),
          name: "白鹿原",
          abstract: "这个书不错哦",
          pagenum: "88"
        }
      ],
      author: [
        {
          book: require("../assets/image/img/book1.png"),
          day: "白鹿原",
          address: "延安",
          abstract: "这个书不错哦",
          name: "名字"
        }
      ],
      navList: [
        // 底部信息
        {
          img: require("../assets/image/nav1.png"),
          name: "书城",
          route: "/index"
        },
        {
          img: require("../assets/image/nav2.png"),
          name: "我的书架",
          route: "/recommend"
        },
        {
          img: require("../assets/image/nav3.png"),
          name: "立即充值",
          route: "/help"
        },
        {
          img: require("../assets/image/nav4.png"),
          name: "邀请",
          route: "/userCenter"
        }
      ]
    };
  },

  computed: {},

  created() {
    this.loading();
  },

  mounted() {},

  methods: {
    navRoute(route) {
      // console.log(route)
      this.$router.push({ path: route });
    },
    loading() {
      // this.$bus.$emit("comAlert", {
      //         title: "温馨提示",
      //         info: "你确定要删除的预约",
      //         button: [
      //           {
      //             text: "取消",
      //             callback: () => {
      //               console.log('取消');
      //             }
      //           },
      //           {
      //             text: "确认",
      //             callback: () => {
      //               console.log('确定');
      //             }
      //           },
      //         ]
      //       });
    }
  }
};
</script>
<style lang='scss'>
#index {
  width: 750px;
  #pageHead {
    box-shadow: none;
    .gone {
      display: none;
    }
  }
  .index {
    height: 590px;
    background: #fff;
    position: relative;
    .indexbg {
      height: 245px;
      background: #41d7bd;
    }
    .lunbo {
      width: 686px;
      height: 280px;
      position: absolute;
      bottom: 200px;
      left: 50%;
      transform: translateX(-50%);
      .mint-swipe-indicator {
        width: 10px;
        height: 12px;
        background: rgba(153, 153, 153, 1);
      }
      .is-active {
        background: #fff;
      }
      img {
        width: 100%;
      }
    }
    .index_nav {
      width: 100%;
      margin-top: 150px;
      height: 200px;
      display: flex;
      justify-content: space-around;
      align-items: center;
      .nav_item {
        width: 25%;
        text-align: center;
        .box {
          width: 80px;
          height: 80px;
          margin: 0 auto;
          img {
            width: 100%;
          }
        }
        span {
          font-size: 26px;
          line-height: 40px;
        }
      }
    }
  }
  .sellwell {
    margin-top: 20px;
    background-color: #fff;
    padding: 0 32px;
    .sellTop {
      display: flex;
      color: #41d7bd;
      justify-content: space-between;
      align-content: center;
      line-height: 84px;
      position: relative;
      span {
        color: #333333;
      }
      span:nth-of-type(1) {
        font-weight: 700;
      }
      &:after {
        content: "";
        height: 28px;
        width: 2px;
        background: #555;
        position: absolute;
        left: -8px;
        top: 27px;
      }
    }
    .bookList {
      height: 340px;
      border-bottom: 1px solid #f6f6f6;
      display: flex;
      justify-content: space-between;
      .left {
        width: 200px;
        height: 260px;
        border-radius: 6px;
        margin-top: 40px;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .right {
        width: 458px;
        height: 240px;
        margin-top: 60px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        font-size: 26px;
        color: rgba(153, 153, 153, 1);
        .name {
          color: #222;
          font-size: 30px;
        }
        .abstract {
          height: 200px;
          display: -webkit-box;
          -webkit-box-orient: vertical;
          -webkit-line-clamp: 3;
          overflow: hidden;
        }
      }
    }
  }
  .author {
    margin-top: 20px;
    background-color: #fff;
    padding: 0 32px;
    .sellTop {
      display: flex;
      color: #41d7bd;
      justify-content: space-between;
      align-content: center;
      line-height: 84px;
      position: relative;
      span {
        color: #333333;
      }
      span:nth-of-type(1) {
        font-weight: 700;
      }
      &:after {
        content: "";
        height: 28px;
        width: 2px;
        background: #555;
        position: absolute;
        left: -8px;
        top: 27px;
      }
    }
    .authormes {
      height: 390px;
      background: url("../assets/image/bookbg.png") no-repeat;
      background-size: contain;
      position: relative;
      .name {
        font-weight: 700;
        position: absolute;
        top: 40px;
        left: 30px;
      }
      .left {
        width: 132px;
        height: 190px;
        border-radius: 6px;
        margin-top: 40px;
        position: absolute;
        top: 85px;
        left: 60px;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .right {
        width: 370px;
        height: 250px;
        margin-top: 20px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        color: #222;
        font-size: 24px;
        position: absolute;
        top: 30px;
        right: 45px;
      }
    }
  }
}
</style>